<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>09方法</title>
</head>
<body>
<script>
  //无参无返回值
  function f1() {
    console.log("f1");
  }
  //调用方法
  f1();
  //有参无返回值
  function f2(name,age) {
    console.log(name+":"+age)
  }
  f2("张三",18);
  function f3() {
    return "我是返回值！";
  }
  let info = f3();
  console.log(info);
  function f4(x,y) {
    return x*y;
  }
  let result = f4(8,9);
  console.log(result);

  //第二种
  let f5=function (name,age) {
    console.log(name+":"+age);
  }
  f5("李四",20);
  let f6= new Function("name","age","console.log(name+':'+age)");
  f6("王五",80);
</script>
</body>
</html>